#ifndef _STRUCT_H
#define _STRUCT_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct CHAR_FRE {
    unsigned char charbody;
    int freq;
} TEXT;

typedef struct HAFFMAN_TREE {
    TEXT charFreq;
    struct HAFFMAN_TREE *leftChild;
    struct HAFFMAN_TREE *rightChild;
    enum{F, T} visited;
    char *code;
}CODING;

typedef struct STACK {
    struct STACK *top;
    int num;
}stack;

typedef struct LINE {
    struct HAFFMAN_TREE *tar;
} LINE;

typedef struct FILE_HEAD
{
    unsigned char flag[3];
    unsigned char variety;
    unsigned char lastValueBit;
    unsigned char unused[11];
} HEAD;
#endif